﻿
using Xacml.Core;
using System;
using System.Xml;

namespace Xacml.Core.Policy
{
  public class RuleCombinerParameterElement : CombinerParameterElement
  {
    private Uri _ruleIdRef;

    public Uri RuleIdRef
    {
      get
      {
        return this._ruleIdRef;
      }
    }

    public RuleCombinerParameterElement(string parameterName, AttributeValueElement attributeValue, Uri ruleIdRef, XacmlVersion version)
      : base(parameterName, attributeValue, version)
    {
      this._ruleIdRef = ruleIdRef;
    }

    public RuleCombinerParameterElement(XmlReader reader, XacmlVersion version)
      : base(reader, "RuleCombinerParameterElement", version)
    {
    }

    protected override void AttributeFound(XmlReader reader)
    {
      if (!(reader.LocalName == "RuleIdRef"))
        return;
      this._ruleIdRef = new Uri(reader.GetAttribute("RuleIdRef"));
    }
  }
}
